<template>
	<view class="merchantver">
		<!-- 步骤组件 -->
		<view class="stepcon">
			<uni-steps :options="step.option" :active="currentStep"></uni-steps>
		</view>
		
		<view class="content">
			<view class="step2" v-if="currentStep==1">
				<merchantverStep2 ref="merchantverStep2" @nextAfter="nextAfter" :shopData="shopData"></merchantverStep2>
			</view>
			
			<view class="step3" v-if="currentStep==2">
				<merchantverStep3 ref="merchantverStep3"></merchantverStep3>
			</view>
		</view>
	</view>
</template>

<script>
	import uniSteps from '@/components/uni-steps/uni-steps.vue'
	import merchantverStep2 from '../../components/sevice/merchantverStep2.vue'
	import merchantverStep3 from '../../components/sevice/merchantverStep3.vue'
	export default {
		data() {
			return {
				shopData:'',
				currentStep:1,
				step:{
					option:[
						{title: '身份认证'}, 
						// {title: '扫描业务码'}, 
						{title: '创建店铺'}, 
						// {title: '扫描台卡'}, 
						{title: '店铺认证'},
					]
				},
				tag:'' //门店标签
			}
		},
		onLoad:function(data){
			this.shopData = data;
			if(data.step == '5'){ //判断是否跳到第三步
				this.currentStep = 2;
			}
			console.log(this.shopData);
		},
		onShow:function(){
			if(this.currentStep == 1){
				let location = this.$store.state.merchantver.location;
				if(location!=''){
					this.$refs.merchantverStep2.getLocation()
				}
			}
		},
		methods: {
			//点击下一步
			// next:function(){
			// 	if(this.currentStep == 1){//填写信息页面点击下一步
			// 		this.$refs.merchantverStep2.assistauthinfoFun()
			// 	}else if(this.currentStep == 2){// 上传资料页面点击下一步
			// 		this.$refs.merchantverStep3.assistauthuploadFun();
			// 	}
			// },
			//下一步执行成功的函数
			nextAfter:function(){
				this.currentStep = this.currentStep+1;
			}
		},
		components: {
			uniSteps,
			merchantverStep2,
			merchantverStep3
		}
	}
</script>

<style lang="scss" scoped>
	.merchantver{
		padding-top: 160rpx;
		position: relative;
		border-top: 1rpx solid #E5E5E5;
		height: 100%;
		background-color: #F5F5F5;
		font-size: $uni-font-size-base;
		box-sizing: border-box;
		.stepcon{
			height: 160rpx;
			position: absolute;
			left: 0;
			right: 0;
			top: 0;
			box-sizing: border-box;
			background-color: #FFFFFF;
			padding-top: 60rpx;
		}
		.content{
			height: 100%;
			.step2{
				height: 100%;
			}
		}
	}
</style>
